package com.example.charstream;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class CharStreamDemo4 {
    public static void main(String[] args) throws IOException {

        /**
         * 读取数据存在缓冲区(长度为8192的字节数组)
         */

        FileReader fr = new FileReader("src/com/example/file/d.txt");

        int read1 = fr.read();
        System.out.println(read1);
        System.out.println((char) read1);

        int read2 = fr.read();
        System.out.println(read2);
        System.out.println((char) read2);

        int read3 = fr.read();
        System.out.println(read3);
        System.out.println((char) read3);

    }
}
